/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

/* 标题区域 */
header {
    text-align: center;
    margin-bottom: 25px;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 8px;
}

header p {
    color: #7f8c8d;
}

/* 输入区域 */
.input-section {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

#taskInput {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#taskInput:focus {
    outline: none;
    border-color: #3498db;
}

#addTaskBtn {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

#addTaskBtn:hover {
    background-color: #2980b9;
}

/* 过滤器 */
.filters {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.filter-btn {
    padding: 8px 15px;
    background-color: #ecf0f1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background-color: #3498db;
    color: white;
}

/* 任务列表 */
#taskList {
    list-style-type: none;
    margin-bottom: 20px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-text {
    flex: 1;
    margin: 0 15px;
    word-break: break-word;
}

.task-completed .task-text {
    text-decoration: line-through;
    color: #95a5a6;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.delete-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.delete-btn:hover {
    opacity: 1;
}

/* 底部统计 */
.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

#clearCompleted {
    padding: 6px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#clearCompleted:hover {
    background-color: #c0392b;
}

/* 响应式设计 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .filters {
        flex-wrap: wrap;
    }
}